<%@ page import="com.jy.dao.UserDao" %>
<%@ page import="com.jy.entity.Student" %>
<%@ page import="com.jy.entity.Teacher" %>
<%@ page import="com.jy.dao.impl.UserDaoImpl" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page isELIgnored="false" %>
<html>
<head>
    <%
        Object act=request.getSession().getAttribute("act");
        Object sf=request.getSession().getAttribute("sf");
        UserDao user=new UserDaoImpl();
        Student s = null;
        Teacher t=null;
        if(sf=="student") {
            s = user.getstuid((String) act);
        }else{
            t=user.getteacher("select *from teacher where tname=?",act);
        }
        System.out.println("用户名:"+act);
        System.out.println("身份:"+sf);
    %>
    <title>视频课堂--teacher</title>
    <link rel="icon" href="../images/logo.png" type="image/x-icon">
    <link rel="stylesheet" href="../css/bootstrap.css">
    <link rel="stylesheet" href="../css/fonts.css">
    <link rel="stylesheet" href="../css/style.css">
    <script src="../js/core.min.js"></script>
    <script src="../js/script.js"></script>
    <style>
        body{
            height: 100%;
        }
        .nav1 {
            position: relative; /* 设置相对定位 */
            padding-left: 30px;
            display: inline-block; /* 让元素具有块级元素和行内元素的特性,即将块级元素转化为内联元素 */
        }

        .nav2 {
            display: none; /* 将某元素隐藏起来 */
            position: absolute; /* 绝对定位 */
            background-color: #f9f9f9;
            min-width: 81px; /* 最小宽度 */
        }

        #d1{
            width:100%;
            position: relative;
        }

        .index-title-h3 {
            line-height: 1.15;
            -webkit-text-size-adjust: 100%;
            -webkit-font-smoothing: antialiased;
            text-rendering: optimizeLegibility;
            font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
            -webkit-box-direction: normal;
            box-sizing: inherit;
            font-size: 22px;
            font-weight: 400;
            color: #1f2f3d;
            border-left: 10px solid #2ce8b4;
            padding-left: 10px;
            margin-left: 252px;
        }
        #sj{
            margin-left: 245px;
        }

        .bottom clearfix {
            -webkit-text-size-adjust: 100%;
            -webkit-font-smoothing: antialiased;
            text-rendering: optimizeLegibility;
            font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
            -webkit-box-direction: normal;
            color: #303133;
            box-sizing: inherit;
            margin-top: 13px;
            line-height: 12px;
        }

        .el-card__body{
            line-height: 1.15;
            -webkit-text-size-adjust: 100%;
            -webkit-font-smoothing: antialiased;
            text-rendering: optimizeLegibility;
            font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Arial,sans-serif;
            -webkit-box-direction: normal;
            color: #303133;
            box-sizing: inherit;
            width:217px;
            height:216px;
            float: left;
            margin-right:50px;
            box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
            margin-bottom: 20px;
        }
        .image{
            line-height: 1.15;
            -webkit-text-size-adjust: 100%;
            -webkit-font-smoothing: antialiased;
            text-rendering: optimizeLegibility;
            font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Arial,sans-serif;
            -webkit-box-direction: normal;
            color: #303133;
            box-sizing: inherit;
            border-style: none;
            width: 107px;
            height: 107px;
            display: block;
            margin: 20px auto 10px auto;
        }
        .el-col el-col-4 el-col-offset-0{
            line-height: 1.15;
            -webkit-text-size-adjust: 100%;
            -webkit-font-smoothing: antialiased;
            text-rendering: optimizeLegibility;
            font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Arial,sans-serif;
            -webkit-box-direction: normal;
            float: left;
            box-sizing: border-box;
            margin-left: 0;
            width: 16.66667%;
        }
        .el-card is-always-shadow{
            line-height: 1.15;
            -webkit-text-size-adjust: 100%;
            -webkit-font-smoothing: antialiased;
            text-rendering: optimizeLegibility;
            font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Arial,sans-serif;
            -webkit-box-direction: normal;
            box-sizing: inherit;
            border-radius: 4px;
            overflow: hidden;
            border: 1px solid #ebeef5;
            background-color: #fff;
            color: #303133;
            transition: .3s;
            box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
        }
        #gd1{
            line-height: 1.15;
            -webkit-text-size-adjust: 100%;
            -webkit-font-smoothing: antialiased;
            text-rendering: optimizeLegibility;
            font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Arial,sans-serif;
            -webkit-box-direction: normal;
            color: #303133;
            box-sizing: inherit;
            font-size: 16px;
        }

        .el-button button el-button--text el-button--medium{
            -webkit-text-size-adjust: 100%;
            -webkit-font-smoothing: antialiased;
            -webkit-box-direction: normal;
            font-family: inherit;
            overflow: visible;
            text-transform: none;
            -webkit-user-select: none;
            display: inline-block;
            line-height: 1;
            white-space: nowrap;
            cursor: pointer;
            -webkit-appearance: none;
            text-align: center;
            box-sizing: border-box;
            outline: 0;
            margin: 0;
            transition: .1s;
            font-weight: 500;
            border-color: transparent;
            font-size: 14px;
            border-radius: 4px;
            color: #409eff;
            background: 0 0;
            padding: 0;
            float: right;
        }
        #ks{
            -webkit-text-size-adjust: 100%;
            -webkit-font-smoothing: antialiased;
            -webkit-box-direction: normal;
            font-family: inherit;
            text-transform: none;
            -webkit-user-select: none;
            line-height: 1;
            white-space: nowrap;
            cursor: pointer;
            text-align: center;
            font-weight: 500;
            font-size: 14px;
            color: #66b1ff;
            box-sizing: inherit;
        }
        #cf{
            height:450px;
        }
    </style>
</head>
<body>
<header class="page-header">

    <div class="rd-navbar-wrap">
        <nav class="rd-navbar rd-navbar-classic" data-layout="rd-navbar-fixed" data-sm-layout="rd-navbar-fixed" data-md-layout="rd-navbar-fixed" data-md-device-layout="rd-navbar-fixed" data-lg-layout="rd-navbar-static" data-lg-device-layout="rd-navbar-fixed" data-xl-layout="rd-navbar-static" data-xl-device-layout="rd-navbar-static" data-lg-stick-up-offset="46px" data-xl-stick-up-offset="46px" data-xxl-stick-up-offset="46px" data-lg-stick-up="true" data-xl-stick-up="true" data-xxl-stick-up="true">
            <na class="rd-navbar-main-outer">
                <div class="rd-navbar-main">

                    <div class="rd-navbar-panel">

                        <button class="rd-navbar-toggle" data-rd-navbar-toggle=".rd-navbar-nav-wrap"><span></span></button>

                        <div class="rd-navbar-brand"><a class="brand" href="/examproject/nologin/index.jsp"><img class="brand-logo-dark" src="/examproject/images/logo.png" alt="" width="245" height="50"/><img class="brand-logo-light" src="../images/logo.png" alt="" width="245" height="50"/></a>
                        </div>
                    </div>
                    <div class="rd-navbar-nav-wrap">

                        <div class="rd-navbar-nav">
                            <li class="rd-nav-item active"><a class="rd-nav-link" href="/examproject/nologin/index.jsp">首页</a>
                            </li>
                            <li class="rd-nav-item"><a class="rd-nav-link" href="/examproject/html/mncs.jsp">模拟测试</a>
                            </li>
                            <div class="nav1">
                                <li class="rd-nav-item"><a class="rd-nav-link" href="/examproject/stu/gettimetest" onmouseover="showmore('showdiv2')" onmouseout="nonemore('showdiv2')">试卷中心</a>
                                </li>
                                <div class="nav2" id="showdiv2" onmouseover="showmore(this.id)" onmouseout="nonemore(this.id)">
                                    <a class="rd-nav-link" href="/examproject/stu/gettimetest" >班级试卷</a>
                                    <br/>
                                    <a class="rd-nav-link" href="/examproject/stu/gettimetest">时段试卷</a>
                                    <br/>
                                    <a class="rd-nav-link" href="/examproject/stu/gettimetest">固定试卷</a>
                                </div>
                            </div>
                            <div class="nav1">
                                <li class="rd-nav-item"><a class="rd-nav-link" href="/examproject/stu/getvideo" onmouseover="showmore('showdiv1')" onmouseout="nonemore('showdiv1')">课堂视频</a>
                                </li>
                                <div class="nav2" id="showdiv1" onmouseover="showmore(this.id)" onmouseout="nonemore(this.id)">
                                    <a class="rd-nav-link" href="/examproject/stu/getvideo" >教学视频</a>
                                    <br/>
                                    <a class="rd-nav-link" href="/examproject/stu/getvideo">课堂回放</a>

                                </div>
                            </div>
                            <%if(sf=="student"||sf==null){%>
                            <li class="rd-nav-item" style="padding-left: 45px;"><a class="rd-nav-link" href="/examproject/stu/getexamrecord">考试记录</a>
                            </li>
                            <%}%>
                            <div class="nav1">
                                <li class="rd-nav-item"><a class="rd-nav-link" href="#" onmouseover="showmore('showdiv')" onmouseout="nonemore('showdiv')">更多</a>
                                </li>
                                <div id="showdiv" class="nav2" onmouseover="showmore(this.id)" onmouseout="nonemore(this.id)">
                                    <%if(sf=="student"||sf==null){%>
                                    <a class="rd-nav-link" href="/examproject/stu/falsebook" >错题本</a>
                                    <br/>
                                    <a class="rd-nav-link" href="/examproject/stu/findclass">我的班级</a>
                                    <br/>
                                    <a class="rd-nav-link" href="/examproject/stu/queryJ">留言板</a>
                                    <%}else{%>
                                    <a class="rd-nav-link" href="/examproject/html/zyqk.jsp">作业情况</a>
                                    <%}%>
                                </div>
                            </div>
                            <div style="padding-left: 100px;">
                                <li class="rd-nav-item">
                                    <%if(act==null){%>
                                    <a class="rd-nav-link" href="/examproject/nologin/LogInTo.jsp">登陆</a>||
                                    <a class="rd-nav-link" href="/examproject/nologin/Register.jsp">注册</a>
                                    <%}else{%>
                                    <div class="nav1">
                                        <%if(sf=="student"&&s.getStavatar()!=null){%>
                                        <img src="<%=s.getStavatar()%>" style="border-radius: 24px;width:48px;height:48px;">
                                        <%}else if(sf=="teacher"&&t.getThavatar()!=null){%>
                                        <img src="<%=t.getThavatar()%>" style="border-radius: 24px;width:48px;height:48px;">
                                        <%}else{%>
                                        <img src= "/examproject/images/mrtx.png" style="border-radius: 24px;width:48px;height:48px;">
                                        <%}%>
                                        <a class="rd-nav-link" onclick="yh('showdiv3')" href="#"><%=act%></a>
                                        <div class="nav2" id="showdiv3" onmouseover="showmore(this.id)" onmouseout="nonemore(this.id)">
                                            <a class="rd-nav-link" href="/examproject/stu/myinfo" >个人信息</a>
                                            <br/>
                                            <a class="rd-nav-link" href="/examproject/no/remove">退出</a>
                                        </div>
                                    </div>
                                    <%}%>
                                </li>
                            </div>
                            </ul>
                        </div>
                    </div>
                </div>
            </na>
        </nav>
    </div>
</header>
<div id="d1">
    <h3 data-v-30b99046="" class="index-title-h3"
        style="border-left: 10px solid rgb(54, 81, 212);margin-top: 22px;margin-bottom:22px">教学视频</h3>
    <div style="padding-left: 15px;" id="sj">
        <c:forEach items="${list1}" var="j">
            <div class="el-card__body" style="padding: 0px;" id="body">
                <img data-v-30b99046="" src="https://tse1-mm.cn.bing.net/th/id/R-C.f61524efbe728c2cc5d1fb69da0d1a36?rik=RjLnQF%2bxHH306w&riu=http%3a%2f%2fimg1.juimg.com%2f190428%2f315452-1Z42P93S372.jpg&ehk=5QgYiLjB%2fNUnr0BXFMjFvbW83C5U37RLVt3nQxSIHZU%3d&risl=&pid=ImgRaw" class="image">
                <div data-v-30b99046="" style="padding: 14px;margin-left:42px "><span data-v-30b99046="" id="gd1">${j.vname}</span>
                    <div data-v-30b99046="" class="bottom clearfix">
                        <a data-v-30b99046="" href="${j.vurl}" class="" target="_blank">
                            <button data-v-30b99046="" type="button" class="el-button button el-button--text el-button--medium">
                                <span id="ks">立即观看</span>
                            </button>
                        </a>
                    </div>
                </div>
            </div>
        </c:forEach>
    </div>

<%--    创建视频--%>
    <div style="padding-left: 15px;" id="sj">
            <div class="el-card__body" style="padding: 0px;" id="body">
                <img data-v-30b99046="" src="/examproject/images/addtest.jpg" class="image" onclick="add()">
            </div>
    </div>

</div>
<div id="cf"></div>
<div id="d1">
    <h3 data-v-30b99046="" class="index-title-h3" style="margin-top: 22px;margin-bottom:22px">课堂回放</h3>
    <div style="padding-left: 15px;" id="sj">
        <c:forEach items="${list2}" var="k">
            <div class="el-card__body" style="padding: 0px;" id="body">
                <img data-v-30b99046="" src="https://tse1-mm.cn.bing.net/th/id/R-C.f61524efbe728c2cc5d1fb69da0d1a36?rik=RjLnQF%2bxHH306w&riu=http%3a%2f%2fimg1.juimg.com%2f190428%2f315452-1Z42P93S372.jpg&ehk=5QgYiLjB%2fNUnr0BXFMjFvbW83C5U37RLVt3nQxSIHZU%3d&risl=&pid=ImgRaw" class="image">
                <div data-v-30b99046="" style="padding: 14px;margin-left:42px "><span data-v-30b99046="" id="gd1">${k.vname}</span>
                    <div>所属班级id:${k.classid}</div>
                    <div data-v-30b99046="" class="bottom clearfix">
                        <a data-v-30b99046="" href="${k.vurl}" class="" target="_blank">
                            <button data-v-30b99046="" type="button" class="el-button button el-button--text el-button--medium">
                                <span id="ks">立即播放</span>
                            </button>
                        </a>
                    </div>
                </div>
            </div>
        </c:forEach>
    </div>

    <%--    创建视频--%>
    <div style="padding-left: 15px;" id="sj">
        <div class="el-card__body" style="padding: 0px;" id="body">
            <img data-v-30b99046="" src="/examproject/images/addtest.jpg" class="image" onclick="add()">
        </div>
    </div>
</div>
</body>
<script src="../js/core.min.js"></script>
<script src="../js/script.js"></script>
<script>
    function showmore(id) {
        var d = document.getElementById(id);
        d.style.display = "block";
    }

    function nonemore(id) {
        var d = document.getElementById(id);
        d.style.display = "NONE";
    }
    function yh(id) {
        var d=document.getElementById(id);
        d.style.display="block";
    }
    function add() {
        location.href="/examproject/html/createvideo.jsp";
    }
</script>
</html>
